import "babel-polyfill";

import Vue from "vue";
import App from './App.vue';

import './statics/site/css/style.css';

import moment from 'moment';

//导入全部的element样式
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// Vue.use(ElementUI);

//按需导入element样式
import {
    Button,
    Pagination,
    Input,
    InputNumber,
    Switch,
    Form,
    FormItem,
    Radio,
    RadioGroup,
    MessageBox,
    Message,
    Carousel,
    CarouselItem,
    Row,
    Col
} from 'element-ui'

Vue.use(Button) //自动导入element-ui/lib/theme-chalk/button.css
Vue.use(Pagination)
Vue.use(InputNumber)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Input)
Vue.use(Switch)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(Row)
Vue.use(Col)

Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm

import VueLazyload from 'vue-lazyload'
// const path = require('path');

import {store} from './components/vuex/index';


Vue.use(VueLazyload, {
    // loading: path.join(__dirname,"src/statics/site/images/01.gif")
    loading:require('./statics/site/images/01.gif')
})


  Vue.filter('dataFmt',(input,formatStr='YYYY-MM-DD')=>{
      return moment(input).format(formatStr);
  })


import router from './components/router/index';
new Vue({
    el:'#app',
    render:function(createElement){
        return createElement(App)
    },
    router,
    store
})
